<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Apple devices fullscreen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Apple devices fullscreen -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" media="screen"/>
<link href="/public/plugins/layui/css/layui.css?v=v1.6.3" rel="stylesheet" type="text/css">
<link href="/public/static/admin/css/main.css?v=v1.6.3" rel="stylesheet" type="text/css">
<link href="/public/static/admin/css/page.css?v=v1.6.3" rel="stylesheet" type="text/css">
<link href="/public/static/admin/font/css/font-awesome.min.css?v=v1.6.3" rel="stylesheet" />
<link href="/public/static/admin/font/css/iconfont.css?v=v1.6.3" rel="stylesheet" />
<!--[if IE 7]>
  <link rel="stylesheet" href="/public/static/admin/font/css/font-awesome-ie7.min.css?v=v1.6.3">
<![endif]-->
<script type="text/javascript">
    var eyou_basefile = "/login.php";
    var module_name = "admin";
    var GetUploadify_url = "/uploads.html";
    // 插件专用旧版上传图片框
    if ('Weapp@execute' == "AdPosition@index") {
      GetUploadify_url = "/uploads.html";
    }
    var __root_dir__ = "";
    var __lang__ = "cn";
    var __seo_pseudo__ = 1;
    var __web_xss_filter__ = 0;
    var __is_mobile__ = 0;
    var __security_ask_open__ = 0;
</script>  
<link href="/public/static/admin/js/jquery-ui/jquery-ui.min.css?v=v1.6.3" rel="stylesheet" type="text/css"/>
<link href="/public/static/admin/js/perfect-scrollbar.min.css?v=v1.6.3" rel="stylesheet" type="text/css"/>
<!-- <link type="text/css" rel="stylesheet" href="/public/plugins/tags_input/css/jquery.tagsinput.css?v=v1.6.3"> -->
<style type="text/css">html, body { overflow: visible;}</style>
<link href="/public/static/admin/css/diy_style.css?v=v1.6.3" rel="stylesheet" type="text/css" />

<!-- 官方内置样式表，升级会覆盖变动，请勿修改，否则后果自负 -->

<style type="text/css">
	/*左侧收缩图标*/
	#foldSidebar i { font-size: 24px;color:#3398cc; }
    /*左侧菜单*/
    .eycms_cont_left{ background:#3398cc; }
    .eycms_cont_left dl dd a:hover,.eycms_cont_left dl dd a.on,.eycms_cont_left dl dt.on{ background:#2189be; }
    .eycms_cont_left dl dd a:active{ background:#2189be; }
    .eycms_cont_left dl.jslist dd{ background:#3398cc; }
    .eycms_cont_left dl.jslist dd a:hover,.eycms_cont_left dl.jslist dd a.on{ background:#2189be; }
    .eycms_cont_left dl.jslist:hover{ background:#2189be; }
    /*栏目操作*/
    .cate-dropup .cate-dropup-con a:hover{ background-color: #3398cc; }
    /*按钮*/
    a.ncap-btn-green { background-color: #3398cc; }
    a:hover.ncap-btn-green { background-color: #2189be; }
    .flexigrid .sDiv2 .btn:hover { background-color: #3398cc; }
    .flexigrid .mDiv .fbutton div.add{background-color: #3398cc; border: none;}
    .flexigrid .mDiv .fbutton div.add:hover{ background-color: #2189be;}
	.flexigrid .mDiv .fbutton div.adds{color:#3398cc;border: 1px solid #3398cc;}
	.flexigrid .mDiv .fbutton div.adds:hover{ background-color: #3398cc;}
    /*选项卡字体*/
    .tab-base a.current,
    .tab-base a:hover.current {color:#3398cc !important;}
    .tab-base a.current:after,
    .tab-base a:hover.current:after {background-color: #3398cc;}
    .addartbtn input.btn:hover{ border-bottom: 1px solid #3398cc; }
    .addartbtn input.btn.selected{ color: #3398cc;border-bottom: 1px solid #3398cc;}
	/*会员导航*/
	.member-nav-group .member-nav-item .btn.selected{background: #3398cc;border: 1px solid #3398cc;box-shadow: -1px 0 0 0 #3398cc;}
	.member-nav-group .member-nav-item:first-child .btn.selected{border-left: 1px solid #3398cc !important;}
	/*搜索按钮图标*/
	.flexigrid .sDiv2 .fa-search{}
        
    /* 商品订单列表标题 */
   .flexigrid .mDiv .ftitle h3 {border-left: 3px solid #3398cc;} 
	
    /*分页*/
    .pagination > .active > a, .pagination > .active > a:focus, 
	.pagination > .active > a:hover, 
	.pagination > .active > span, 
	.pagination > .active > span:focus, 
	.pagination > .active > span:hover { border-color: #3398cc;color:#3398cc; }
    
    .layui-form-onswitch {border-color: #3398cc !important;background-color: #3398cc !important;}
    .onoff .cb-enable.selected { background-color: #3398cc !important;border-color: #3398cc !important;}
    .onoff .cb-disable.selected {background-color: #3398cc !important;border-color: #3398cc !important;}
    .pcwap-onoff .cb-enable.selected { background-color: #3398cc !important;border-color: #3398cc !important;}
    .pcwap-onoff .cb-disable.selected {background-color: #3398cc !important;border-color: #3398cc !important;}
    input[type="text"]:focus,
    input[type="text"]:hover,
    input[type="text"]:active,
    input[type="password"]:focus,
    input[type="password"]:hover,
    input[type="password"]:active,
    textarea:hover,
    textarea:focus,
    textarea:active { border-color:rgba(51,152,204,0.8);box-shadow: 0 0 0 1px rgba(51,152,204,0.5) !important;}
    .input-file-show:hover .type-file-button {background-color:#3398cc !important; }
    .input-file-show:hover {border-color: #3398cc !important;box-shadow: 0 0 5px rgba(51,152,204,0.5) !important;}
    .input-file-show:hover span.show a,
    .input-file-show span.show a:hover { color: #3398cc !important;}
    .input-file-show:hover .type-file-button {background-color: #3398cc !important; }
    .color_z { color: #3398cc !important;}
    a.imgupload{
        background-color: #3398cc !important;
        border-color: #3398cc !important;
    }
    /*专题节点按钮*/
    .ncap-form-default .special-add{background-color:#3398cc;border-color:#3398cc;}
    .ncap-form-default .special-add:hover{background-color:#2189be;border-color:#2189be;}
    
    /*更多功能标题*/
    .on-off_panel .title::before {background-color:#3398cc;}
    .on-off_panel .on-off_list-caidan .icon_bg .on{color: #3398cc;}
    .on-off_panel .e-jianhao {color: #3398cc;}
    
     /*内容菜单*/
    .ztree li a:hover{color:#3398cc !important;}
    .ztree li a.curSelectedNode{background-color: #3398cc !important; border-color:#3398cc !important;}
    .layout-left .on-off-btn {background-color: #3398cc !important;}

    .iframe_loading{
        width:100%;
        background:url(/public/static/admin/images/loading-0.gif) no-repeat center center;
    }
    
    .layui-btn-normal {background-color: #3398cc;}
    
    /* 商品规格按钮 */
    /* .preset-bt{border-color: #3398cc !important;background:#3398cc;} */
</style>
<script type="text/javascript" src="/public/static/admin/js/jquery.js?v=v1.6.3"></script>
<!-- <script type="text/javascript" src="/public/plugins/tags_input/js/jquery.tagsinput.js?v=v1.6.3"></script> -->
<script type="text/javascript" src="/public/static/admin/js/jquery-ui/jquery-ui.min.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/plugins/layer-v3.1.0/layer.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.cookie.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/static/admin/js/admin.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.validation.min.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/static/admin/js/common.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/static/admin/js/perfect-scrollbar.min.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.mousewheel.js?v=v1.6.3"></script>
<script type="text/javascript" src="/public/plugins/layui/layui.js?v=v1.6.3"></script>
<script src="/public/static/admin/js/myFormValidate.js?v=v1.6.3"></script>
<script src="/public/static/admin/js/myAjax2.js?v=v1.6.3"></script>
<script src="/public/static/admin/js/global.js?v=v1.6.3"></script>

<link href="css/index.css" rel="stylesheet" type="text/css" />
<script src="js/vue.min.js"></script>
<script src="js/vue-resource.min.js"></script>
<script src="js/index.js"></script>


</head>

<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-10" id="app">
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
				        				 <div class="fbutton">
        				     <a href="/ad_add.html" data-href="/ad_add.html" >
        				         <div class="add">
        				             <span><i class="layui-icon layui-icon-addition"></i>新增广告</span>
        				         </div>
        				     </a>
        				 </div>
				                </div>
            <form id="searchForm" class="navbar-form form-inline" action="/login.php?m=admin&c=AdPosition&a=index&lang=cn" method="get" onsubmit="layer_loading('正在处理');">
                <input type="hidden" name="m" value="admin"><input type="hidden" name="c" value="AdPosition"><input type="hidden" name="a" value="index"><input type="hidden" name="lang" value="cn">                <div class="sDiv">
                    
                    <div class="sDiv2">
                        <input type="text" size="30" name="keywords" value="" v-model="search" class="qsbox" placeholder="名称搜索...">
                        <input type="submit" class="btn" @click.prevent="mysearch()" value="搜索">
						<i class="iconfont e-sousuo"></i>
                    </div>
                </div>
            </form>
        </div>

        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                        <tr>
                                                            <th class="sign w40" axis="col0">
                                    <div class="tc"><input type="checkbox" class="checkAll"></div>
                                </th>
                            
                            <th abbr="article_title" axis="col3" class="w60">
                                <div class="tc">ID</div>
                            </th>

                            <th abbr="article_title" axis="col3">
                                <div class="tl text-l10" style="width: 100%">广告名称</div>
                            </th>

                            <th abbr="article_title" axis="col3" class="w100">
                                <div class="tc">广告类型</div>
                            </th>

                            <th abbr="article_title" axis="col3" class="w120">
                                <div class="tc">封面图片</div>
                            </th>

                            <th abbr="article_time" axis="col6" class="w60">
                                <div class="tc">启用</div>
                            </th>

                            <th axis="col1" class="w180">
                                <div class="tc">操作</div>
                            </th>
                        </tr>
                    </thead>
                </table>
            </div>
        </div>

        <div class="bDiv" style="height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                            <tr v-for="vlist in list">
                                <td class="sign">
                                    <div class="w40 tc"> <input type="checkbox" name="ids[]" value="3"> </div>
                                </td>
                                                                <td>
                                    <div class="tc w60">{{vlist.id}}</div>
                                </td>

                                <td align="left" style="width:100%;">
                                    <div class="tl text-l10">
                                        <a href="javascript:void(0);" data-href="/login.php?m=admin&c=AdPosition&a=edit&id=3&lang=cn" data-closereload="1" onclick="openFullframe(this, '编辑广告', '100%', '100%');">{{vlist.title}}</a>
                                    </div>
                                </td>
                                <td>
                                    <div class="tc w100">{{vlist.media_type}}</div>
                                </td>
                                <td>
                                    <div class="tc w120">
                                        <ul class="adpic">
                                            <li>
                                                <img :src="vlist.litpic"> <span>{{vlist.pid}}</span>      
                                            </li>
                                        </ul>
                                    </div>
                                </td>
                                <td>
                                    <div class="tc w60">
                                        <span v-if="vlist.status==1" :class="vlist.status==1?'yes':'no'"  ><i class="fa fa-check-circle"></i>是</span>
                                        
                                        <span v-else :class="vlist.status==1?'yes':'no'"  ><i class="fa fa-check-circle"></i>否</span>
                                    </div>
                                </td>
                                <td class="operation">
                                    <div class="w180 tc">
                                        <a :href="'/ad_edit.html?id='+vlist.id" data-href="" data-closereload="1" class="btn blue" onclick="openFullframe(this, '编辑广告', '100%', '100%');">编辑</a> <i></i>
                                        <a class="btn red"  href="javascript:;" data-url="" @click="delfun(vlist.id)" data-id="3" >删除</a>
                                             <i></i>
                                            									
                                       
                                    </div>
                                </td>
                            </tr>
                         
                                            </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
                <div class="tDiv">
            <div class="tDiv2">
                                    <div class="fbutton checkboxall"> <input type="checkbox" class="checkAll"> </div>
                                            <div class="fbutton">
                            <a onclick="batch_del(this, 'ids');" data-url="/login.php?m=admin&c=AdPosition&a=del&lang=cn" class="layui-btn layui-btn-primary">批量删除</a>
                        </div>
                                    <!-- 分页 -->
                <div class="fbuttonr">
    <div class="pages">
       <div class='dataTables_paginate paging_simple_numbers'><ul class='pagination'>    </ul></div>    </div>
</div>
<div class="fbuttonr">
    <el-pagination
                      background
                      layout="prev, pager, next"
                      @current-change="handleCurrentChange"
                      :total="count">
                    </el-pagination>
    <!--<div class="total">-->
    <!--    <h5>共有2条,每页显示-->
    <!--        <select name="pagesize" style="width: 60px;" onchange="ey_selectPagesize(this);">-->
    <!--            <option  value="20">20</option>-->
    <!--            <option  value="50">50</option>-->
    <!--            <option  selected  value="100">100</option>-->
    <!--            <option  value="200">200</option>-->
    <!--        </select>-->
    <!--    </h5>-->
    <!--</div>-->
</div>
            </div>
            <div style="clear:both"></div>
        </div>
            </div>
</div>

<script type="text/javascript">
    $(function() {
        $('input[name*=ids]').click(function() {
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked', 'checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function() {
            $('input[type=checkbox]').prop('checked', this.checked);
        });
    });
    
    $(document).ready(function() {
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function() {
            $(this).toggleClass('trSelected');
        });

        // 点击刷新数据
        $('.fa-refresh').click(function() {
            location.href = location.href;
        });

        $('#searchForm select[name=type]').change(function(){
            $('#searchForm').submit();
        });
    });

    /**
     * 代码调用js
     * @param id  id
     * @param limit 条数
     */
    function copyToClipBoard(id, limit, type) {
        var advstr = '';
        if (1 == type) {
            advstr = "{eyou:adv pid='" + id + "'}\r\n   <img src='{$"+"field.litpic}' alt='{$"+"field.title}' />\r\n{/eyou:adv";
        } else if (2 == type) {
            advstr = "{eyou:adv pid='" + id + "'}\r\n   <video src='{$"+"field.litpic}' controls preload='auto' oncontextmenu='return fase'></video>\r\n{/eyou:adv";
        } else if (3 == type) {
            advstr = "{eyou:adv pid='" + id + "'}\r\n   {$"+"field.intro}\r\n{/eyou:adv";
        }
        var contentdiv = '<div class="dialog_content" style="margin: 0px; padding: 0px;"><dl style="padding:10px 30px;line-height:30px"><dd>标签 adv 调用：</dd>';
        contentdiv += '<textarea rows="4" cols="60" style="width:400px;height:60px;">' + advstr + '}</textarea>';
        contentdiv += '<dd>JavaScript：</dd>';
        contentdiv += '<dd><input type="text" style=" width:400px;" value="<script type=&quot;text/javascript&quot; src=&quot;http://' + '111.173.104.169:83' + '/index.php?m=api&amp;c=Other&amp;a=other_show&amp;pid=' + id + '&amp;row='+limit+'&quot;><\/script>"></dd>';
        contentdiv += '<dd style="border-top: dotted 1px #E7E7E7; color: #F60;">请将标签adv或JavaScript代码复制并粘贴到对应模板文件中！</dd></dl></div>';
        layer.open({
            title: '代码调用',
            type: 1,
            shade: layer_shade,
            skin: 'layui-layer-demo',
            area: ['480px', '280px'], //宽高
            content: contentdiv
        });
    }

</script>

<div id="goTop">
    <a href="JavaScript:void(0);" id="btntop">
        <i class="fa fa-angle-up"></i>
    </a>
    <a href="JavaScript:void(0);" id="btnbottom">
        <i class="fa fa-angle-down"></i>
    </a>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $('#think_page_trace_open').css('z-index', 99999);
    });
</script>

<script>
    var vm = new Vue({
		el: '#app',
		data: {
			list: [],
			count:0,
			search:"",
			searchstatus:0
		},
		created(){
		  //  let url=window.location.search;
		  //  let urlParams = new URLSearchParams(url);
		  //  this.id=urlParams.get("id");
		  //  this.searchtext=urlParams.get("searchtext");
		    this.details();
		},
		mounted(){
		    
		},
		methods: {
		    details: function() {
			    this.$http.get('api/ad.php').then(function(res){
                    console.log(res.body);   
                    this.list=res.body.data;
                    this.count=res.body.total;
                },function(){
                    console.log('请求失败处理');
                });
			},
			handleCurrentChange:function(p){
			    
                if(this.searchstatus){
                    this.$http.post('api/ad.php',{
    			        page:p,
    			        select:this.searchstatus,
    			        text:this.search
    			    },{emulateJSON: true}).then(function(res){
    			        this.list=res.body.data;
                        this.count=res.body.total;
    			    },function(){
    			        console.log("request fail");
    			    })
                }else{
                    this.$http.post('api/ad.php',{
    			        page:p
    			    },{emulateJSON: true}).then(function(res){
    			        this.list=res.body.data;
                        this.count=res.body.total;
    			    },function(){
    			        console.log("request fail");
    			    })
                }
    			    
			},
			mysearch:function(){

			    this.$http.post('api/ad.php',{
			        text:this.search
			    },{emulateJSON: true}).then(function(res){
			        this.list=res.body.data;
                    this.count=res.body.total;
                    this.searchstatus=res.body.select;
			    },function(){
			        console.log("request fail");
			    })
			},
			delfun:function(id){
			    this.$http.post('api/addelfun.php',{
			        id:id
			    },{emulateJSON: true}).then(function(res){
			        if(res.body.code==200){
			            window.location.href="/ad.html";
			        }
			    },function(){
			        console.log("request fail");
			    })
			}
		}
	})
</script>


</body>
</html>